< previous page page_28 next page >

Page 28
Building the Visual Basic 5 Field Data Types Project
The following project illustrates how different Visual Basic data field types store user input. You also see how Visual Basic responds to input that is out of range for the various data field types.
1. Begin by creating a new Visual Basic project (select File | New Project). Using Table 2.2 and Figure 2.8 as guides, populate the Visual Basic form.
warning.gif
Notice that you are creating a set of four buttons with the same name, but different Index property values. This is a control array. Control arrays offer an excellent way to simplify Visual Basic coding. However, they behave a bit differently than non-arrayed controls. It is important that you build the controls exactly as described in this table.

0028-01.jpg
Figure 2.8.
The form for the Visual Basic
data field types project.
Table 2.2. Controls for the Visual Basic data field types project.
ControlPropertySetting
ProjectNameprjFieldTypes
FormNamefrmFieldTypes
CaptionVB5 Basic Data Field Types
CommandButtonNamecmdBtn
Caption&Add
Height300
Index0
Width1200

(table continued on next page)

 
< previous page page_28 next page >

If you like this book, buy it!